prepTexglm <- function(mod){
  
if("glm" %in% class(mod)){
    
    out_mod <- lmtest::coeftest(mod, vcov = sandwich::vcovCL(mod, cluster = df_exp$respondent))
    
    coef_names <- names(out_mod[,1])
    est <- out_mod[,1]
    se <- out_mod[,2]
    pval <- out_mod[,4]
    aic <- mod$aic
    deviance <- mod$deviance
    N <- nobs(mod)
    
    gof <- c(aic, deviance, N)
    gof_names <- c("AIC", "Deviance", "N")
    gof_decimal <- c(T,T,F)
    
    texreg::createTexreg(coef.names = coef_names,
                         coef = est,
                         se = se,
                         pvalues = pval,
                         gof = gof,
                         gof.names = gof_names,
                         gof.decimal = gof_decimal)
  } else {print("Unknown model")}
  
}
